home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / paslib.arc / CIRCLE.INC < prev    next >
Text File  |  1986-11-03  |  1KB  |  32 lines

  1. PROCEDURE CIRCLE(H,K,R,CLR : INTEGER);
  2.           VAR
  3.              X: INTEGER;
  4.              Y: INTEGER;
  5.              GIBBAGE1 : REAL;
  6.              X2 : INTEGER;
  7.              Y2 : INTEGER;
  8.              FIRSTRUN : BOOLEAN;
  9.              MD : INTEGER;
  10.           BEGIN
  11.                IF MODE THEN MD := 2;
  12.                FIRSTRUN := TRUE;
  13.                FOR X := H-R TO H+R DO
  14.                    BEGIN
  15.                         GIBBAGE1:= SQRT(ABS(SQR(R)-SQR(X-H)))+H;
  16.                         Y:= K-ROUND(GIBBAGE1);
  17.                         IF FIRSTRUN THEN
  18.                            BEGIN
  19.                                 X2 := X;
  20.                                 Y2 := Y;
  21.                            END;
  22.                         FIRSTRUN := FALSE;
  23.                         DRAW(X,Y+H,X2,Y2+H,CLR);
  24.                         DRAW(X,K-Y,X2,K-Y2,CLR);
  25.                         PLOT(X,Y+H,CLR);
  26.                         PLOT(X,K-Y,CLR);
  27.                         X2:=X;
  28.                         Y2:=Y;
  29.  
  30.                    END;
  31.           END;
  32.